package com.cq.sphtech.flow;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.cq.sphtech.R;
import com.cq.sphtech.net.IpInfoTask;
import com.cq.sphtech.util.ActivityUtils;


public class FlowInfoActivity extends AppCompatActivity {
    private FlowInfoPresenter flowInfoPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ipinfo);
        FlowInfoFragment flowInfoFragment = (FlowInfoFragment) getSupportFragmentManager().findFragmentById(R.id.contentFrame);
        if (flowInfoFragment == null) {
            flowInfoFragment = FlowInfoFragment.newInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(),
                    flowInfoFragment, R.id.contentFrame);
        }
        IpInfoTask ipInfoTask = IpInfoTask.getInstance();
        flowInfoPresenter = new FlowInfoPresenter(ipInfoTask, flowInfoFragment);
        flowInfoFragment.setPresenter(flowInfoPresenter);
    }
}
